// Lean compiler output
// Module: Lean.Meta.ProdN
// Imports: public import Lean.Meta.InferType import Lean.Meta.DecLevel
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdMkN___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkFreshLevelMVar(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdN___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkAppB(lean_object*, lean_object*, lean_object*);
static lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__0;
uint8_t l_Lean_Expr_isApp(lean_object*);
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_mkProdMkN___closed__1;
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_back___redArg(lean_object*);
lean_object* l_Lean_Expr_cleanupAnnotations(lean_object*);
lean_object* l_Lean_stringToMessageData(lean_object*);
lean_object* l_Lean_mkApp4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getDecLevel(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_back_x21___redArg(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_getProdFields___closed__5;
lean_object* l_Lean_Meta_instantiateMVarsIfMVarApp___redArg(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_mkProdN___closed__1;
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_getProdFields___closed__3;
static lean_object* l_Lean_Meta_getProdFields___closed__4;
static lean_object* l_Lean_Meta_getProdFields___closed__2;
lean_object* l_Lean_mkLevelMax(lean_object*, lean_object*);
lean_object* lean_st_ref_get(lean_object*);
lean_object* lean_array_pop(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdMkN(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
extern lean_object* l_Lean_instInhabitedExpr;
LEAN_EXPORT lean_object* l_Lean_Meta_getProdFields(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdN(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_mkProdN___closed__0;
static lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1;
lean_object* l_Lean_MessageData_ofExpr(lean_object*);
static lean_object* l_Lean_Meta_getProdFields___closed__6;
static lean_object* l_Lean_Meta_getProdFields___closed__7;
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_constLevels_x21(lean_object*);
lean_object* l_Lean_Expr_appFnCleanup___redArg(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_getProdFields___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkApp3(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* l_Lean_Name_mkStr2(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Expr_isConstOf(lean_object*, lean_object*);
static lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
static lean_object* l_Lean_Meta_getProdFields___closed__0;
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_throwError___at___00Lean_Meta_getProdFields_spec__0_spec__0(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Name_mkStr1(lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* lean_infer_type(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_mkProdMkN___closed__0;
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_throwError___at___00Lean_Meta_getProdFields_spec__0_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Level_normalize(lean_object*);
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0;
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_getProdFields___closed__1;
static lean_object* _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Prod", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0;
x_2 = l_Lean_Name_mkStr1(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_2);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; 
x_10 = lean_ctor_get(x_2, 0);
x_11 = lean_ctor_get(x_2, 1);
x_12 = l_Lean_instInhabitedExpr;
x_13 = l_Array_back_x21___redArg(x_12, x_10);
lean_inc(x_7);
lean_inc_ref(x_6);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_13);
x_14 = l_Lean_Meta_getDecLevel(x_13, x_4, x_5, x_6, x_7);
if (lean_obj_tag(x_14) == 0)
{
uint8_t x_15; 
x_15 = !lean_is_exclusive(x_14);
if (x_15 == 0)
{
uint8_t x_16; 
x_16 = !lean_is_exclusive(x_11);
if (x_16 == 0)
{
lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; 
x_17 = lean_ctor_get(x_14, 0);
x_18 = lean_ctor_get(x_11, 0);
x_19 = lean_ctor_get(x_11, 1);
x_20 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_21 = lean_box(0);
lean_inc(x_19);
x_22 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_22, 0, x_19);
lean_ctor_set(x_22, 1, x_21);
lean_inc(x_17);
x_23 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_23, 0, x_17);
lean_ctor_set(x_23, 1, x_22);
x_24 = l_Lean_mkConst(x_20, x_23);
x_25 = l_Lean_mkAppB(x_24, x_13, x_18);
x_26 = l_Lean_mkLevelMax(x_19, x_17);
x_27 = l_Lean_Level_normalize(x_26);
lean_dec(x_26);
x_28 = lean_array_pop(x_10);
lean_ctor_set(x_11, 1, x_27);
lean_ctor_set(x_11, 0, x_25);
lean_ctor_set(x_2, 0, x_28);
x_29 = lean_unsigned_to_nat(1u);
x_30 = lean_nat_add(x_3, x_29);
lean_dec(x_3);
x_31 = lean_nat_dec_lt(x_30, x_1);
if (x_31 == 0)
{
lean_dec(x_30);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_ctor_set(x_14, 0, x_2);
return x_14;
}
else
{
lean_free_object(x_14);
x_3 = x_30;
goto _start;
}
}
else
{
lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; uint8_t x_48; 
x_33 = lean_ctor_get(x_14, 0);
x_34 = lean_ctor_get(x_11, 0);
x_35 = lean_ctor_get(x_11, 1);
lean_inc(x_35);
lean_inc(x_34);
lean_dec(x_11);
x_36 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_37 = lean_box(0);
lean_inc(x_35);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_35);
lean_ctor_set(x_38, 1, x_37);
lean_inc(x_33);
x_39 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_39, 0, x_33);
lean_ctor_set(x_39, 1, x_38);
x_40 = l_Lean_mkConst(x_36, x_39);
x_41 = l_Lean_mkAppB(x_40, x_13, x_34);
x_42 = l_Lean_mkLevelMax(x_35, x_33);
x_43 = l_Lean_Level_normalize(x_42);
lean_dec(x_42);
x_44 = lean_array_pop(x_10);
x_45 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_45, 0, x_41);
lean_ctor_set(x_45, 1, x_43);
lean_ctor_set(x_2, 1, x_45);
lean_ctor_set(x_2, 0, x_44);
x_46 = lean_unsigned_to_nat(1u);
x_47 = lean_nat_add(x_3, x_46);
lean_dec(x_3);
x_48 = lean_nat_dec_lt(x_47, x_1);
if (x_48 == 0)
{
lean_dec(x_47);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_ctor_set(x_14, 0, x_2);
return x_14;
}
else
{
lean_free_object(x_14);
x_3 = x_47;
goto _start;
}
}
}
else
{
lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; uint8_t x_66; 
x_50 = lean_ctor_get(x_14, 0);
lean_inc(x_50);
lean_dec(x_14);
x_51 = lean_ctor_get(x_11, 0);
lean_inc(x_51);
x_52 = lean_ctor_get(x_11, 1);
lean_inc(x_52);
if (lean_is_exclusive(x_11)) {
 lean_ctor_release(x_11, 0);
 lean_ctor_release(x_11, 1);
 x_53 = x_11;
} else {
 lean_dec_ref(x_11);
 x_53 = lean_box(0);
}
x_54 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_55 = lean_box(0);
lean_inc(x_52);
x_56 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_56, 0, x_52);
lean_ctor_set(x_56, 1, x_55);
lean_inc(x_50);
x_57 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_57, 0, x_50);
lean_ctor_set(x_57, 1, x_56);
x_58 = l_Lean_mkConst(x_54, x_57);
x_59 = l_Lean_mkAppB(x_58, x_13, x_51);
x_60 = l_Lean_mkLevelMax(x_52, x_50);
x_61 = l_Lean_Level_normalize(x_60);
lean_dec(x_60);
x_62 = lean_array_pop(x_10);
if (lean_is_scalar(x_53)) {
 x_63 = lean_alloc_ctor(0, 2, 0);
} else {
 x_63 = x_53;
}
lean_ctor_set(x_63, 0, x_59);
lean_ctor_set(x_63, 1, x_61);
lean_ctor_set(x_2, 1, x_63);
lean_ctor_set(x_2, 0, x_62);
x_64 = lean_unsigned_to_nat(1u);
x_65 = lean_nat_add(x_3, x_64);
lean_dec(x_3);
x_66 = lean_nat_dec_lt(x_65, x_1);
if (x_66 == 0)
{
lean_object* x_67; 
lean_dec(x_65);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
x_67 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_67, 0, x_2);
return x_67;
}
else
{
x_3 = x_65;
goto _start;
}
}
}
else
{
uint8_t x_69; 
lean_dec(x_13);
lean_free_object(x_2);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
x_69 = !lean_is_exclusive(x_14);
if (x_69 == 0)
{
return x_14;
}
else
{
lean_object* x_70; lean_object* x_71; 
x_70 = lean_ctor_get(x_14, 0);
lean_inc(x_70);
lean_dec(x_14);
x_71 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_71, 0, x_70);
return x_71;
}
}
}
else
{
lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
x_72 = lean_ctor_get(x_2, 0);
x_73 = lean_ctor_get(x_2, 1);
lean_inc(x_73);
lean_inc(x_72);
lean_dec(x_2);
x_74 = l_Lean_instInhabitedExpr;
x_75 = l_Array_back_x21___redArg(x_74, x_72);
lean_inc(x_7);
lean_inc_ref(x_6);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_75);
x_76 = l_Lean_Meta_getDecLevel(x_75, x_4, x_5, x_6, x_7);
if (lean_obj_tag(x_76) == 0)
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; uint8_t x_95; 
x_77 = lean_ctor_get(x_76, 0);
lean_inc(x_77);
if (lean_is_exclusive(x_76)) {
 lean_ctor_release(x_76, 0);
 x_78 = x_76;
} else {
 lean_dec_ref(x_76);
 x_78 = lean_box(0);
}
x_79 = lean_ctor_get(x_73, 0);
lean_inc(x_79);
x_80 = lean_ctor_get(x_73, 1);
lean_inc(x_80);
if (lean_is_exclusive(x_73)) {
 lean_ctor_release(x_73, 0);
 lean_ctor_release(x_73, 1);
 x_81 = x_73;
} else {
 lean_dec_ref(x_73);
 x_81 = lean_box(0);
}
x_82 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_83 = lean_box(0);
lean_inc(x_80);
x_84 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_84, 0, x_80);
lean_ctor_set(x_84, 1, x_83);
lean_inc(x_77);
x_85 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_85, 0, x_77);
lean_ctor_set(x_85, 1, x_84);
x_86 = l_Lean_mkConst(x_82, x_85);
x_87 = l_Lean_mkAppB(x_86, x_75, x_79);
x_88 = l_Lean_mkLevelMax(x_80, x_77);
x_89 = l_Lean_Level_normalize(x_88);
lean_dec(x_88);
x_90 = lean_array_pop(x_72);
if (lean_is_scalar(x_81)) {
 x_91 = lean_alloc_ctor(0, 2, 0);
} else {
 x_91 = x_81;
}
lean_ctor_set(x_91, 0, x_87);
lean_ctor_set(x_91, 1, x_89);
x_92 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_92, 0, x_90);
lean_ctor_set(x_92, 1, x_91);
x_93 = lean_unsigned_to_nat(1u);
x_94 = lean_nat_add(x_3, x_93);
lean_dec(x_3);
x_95 = lean_nat_dec_lt(x_94, x_1);
if (x_95 == 0)
{
lean_object* x_96; 
lean_dec(x_94);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
if (lean_is_scalar(x_78)) {
 x_96 = lean_alloc_ctor(0, 1, 0);
} else {
 x_96 = x_78;
}
lean_ctor_set(x_96, 0, x_92);
return x_96;
}
else
{
lean_dec(x_78);
x_2 = x_92;
x_3 = x_94;
goto _start;
}
}
else
{
lean_object* x_98; lean_object* x_99; lean_object* x_100; 
lean_dec(x_75);
lean_dec(x_73);
lean_dec(x_72);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
x_98 = lean_ctor_get(x_76, 0);
lean_inc(x_98);
if (lean_is_exclusive(x_76)) {
 lean_ctor_release(x_76, 0);
 x_99 = x_76;
} else {
 lean_dec_ref(x_76);
 x_99 = lean_box(0);
}
if (lean_is_scalar(x_99)) {
 x_100 = lean_alloc_ctor(1, 1, 0);
} else {
 x_100 = x_99;
}
lean_ctor_set(x_100, 0, x_98);
return x_100;
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
_start:
{
lean_object* x_15; 
x_15 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg(x_4, x_6, x_7, x_10, x_11, x_12, x_13);
return x_15;
}
}
static lean_object* _init_l_Lean_Meta_mkProdN___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("PUnit", 5, 5);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_mkProdN___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lean_Meta_mkProdN___closed__0;
x_2 = l_Lean_Name_mkStr1(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdN(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_7; lean_object* x_8; uint8_t x_9; 
x_7 = lean_unsigned_to_nat(0u);
x_8 = lean_array_get_size(x_1);
x_9 = lean_nat_dec_lt(x_7, x_8);
lean_dec(x_8);
if (x_9 == 0)
{
lean_object* x_10; 
lean_dec_ref(x_1);
x_10 = l_Lean_Meta_mkFreshLevelMVar(x_2, x_3, x_4, x_5);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
if (lean_obj_tag(x_10) == 0)
{
uint8_t x_11; 
x_11 = !lean_is_exclusive(x_10);
if (x_11 == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; 
x_12 = lean_ctor_get(x_10, 0);
x_13 = l_Lean_Meta_mkProdN___closed__1;
x_14 = lean_box(0);
x_15 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_15, 0, x_12);
lean_ctor_set(x_15, 1, x_14);
x_16 = l_Lean_mkConst(x_13, x_15);
lean_ctor_set(x_10, 0, x_16);
return x_10;
}
else
{
lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; 
x_17 = lean_ctor_get(x_10, 0);
lean_inc(x_17);
lean_dec(x_10);
x_18 = l_Lean_Meta_mkProdN___closed__1;
x_19 = lean_box(0);
x_20 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_20, 0, x_17);
lean_ctor_set(x_20, 1, x_19);
x_21 = l_Lean_mkConst(x_18, x_20);
x_22 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_22, 0, x_21);
return x_22;
}
}
else
{
uint8_t x_23; 
x_23 = !lean_is_exclusive(x_10);
if (x_23 == 0)
{
return x_10;
}
else
{
lean_object* x_24; lean_object* x_25; 
x_24 = lean_ctor_get(x_10, 0);
lean_inc(x_24);
lean_dec(x_10);
x_25 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_25, 0, x_24);
return x_25;
}
}
}
else
{
lean_object* x_26; lean_object* x_27; 
x_26 = l_Array_back___redArg(x_1);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_3);
lean_inc_ref(x_2);
lean_inc(x_26);
x_27 = l_Lean_Meta_getDecLevel(x_26, x_2, x_3, x_4, x_5);
if (lean_obj_tag(x_27) == 0)
{
uint8_t x_28; 
x_28 = !lean_is_exclusive(x_27);
if (x_28 == 0)
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32; 
x_29 = lean_ctor_get(x_27, 0);
x_30 = lean_array_pop(x_1);
x_31 = lean_array_get_size(x_30);
x_32 = lean_nat_dec_lt(x_7, x_31);
if (x_32 == 0)
{
lean_dec(x_31);
lean_dec_ref(x_30);
lean_dec(x_29);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
lean_ctor_set(x_27, 0, x_26);
return x_27;
}
else
{
lean_object* x_33; lean_object* x_34; lean_object* x_35; 
lean_free_object(x_27);
x_33 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_33, 0, x_26);
lean_ctor_set(x_33, 1, x_29);
x_34 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_34, 0, x_30);
lean_ctor_set(x_34, 1, x_33);
x_35 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg(x_31, x_34, x_7, x_2, x_3, x_4, x_5);
lean_dec(x_31);
if (lean_obj_tag(x_35) == 0)
{
uint8_t x_36; 
x_36 = !lean_is_exclusive(x_35);
if (x_36 == 0)
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; 
x_37 = lean_ctor_get(x_35, 0);
x_38 = lean_ctor_get(x_37, 1);
lean_inc(x_38);
lean_dec(x_37);
x_39 = lean_ctor_get(x_38, 0);
lean_inc(x_39);
lean_dec(x_38);
lean_ctor_set(x_35, 0, x_39);
return x_35;
}
else
{
lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; 
x_40 = lean_ctor_get(x_35, 0);
lean_inc(x_40);
lean_dec(x_35);
x_41 = lean_ctor_get(x_40, 1);
lean_inc(x_41);
lean_dec(x_40);
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_dec(x_41);
x_43 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_43, 0, x_42);
return x_43;
}
}
else
{
uint8_t x_44; 
x_44 = !lean_is_exclusive(x_35);
if (x_44 == 0)
{
return x_35;
}
else
{
lean_object* x_45; lean_object* x_46; 
x_45 = lean_ctor_get(x_35, 0);
lean_inc(x_45);
lean_dec(x_35);
x_46 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_46, 0, x_45);
return x_46;
}
}
}
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49; uint8_t x_50; 
x_47 = lean_ctor_get(x_27, 0);
lean_inc(x_47);
lean_dec(x_27);
x_48 = lean_array_pop(x_1);
x_49 = lean_array_get_size(x_48);
x_50 = lean_nat_dec_lt(x_7, x_49);
if (x_50 == 0)
{
lean_object* x_51; 
lean_dec(x_49);
lean_dec_ref(x_48);
lean_dec(x_47);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
x_51 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_51, 0, x_26);
return x_51;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54; 
x_52 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_52, 0, x_26);
lean_ctor_set(x_52, 1, x_47);
x_53 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_53, 0, x_48);
lean_ctor_set(x_53, 1, x_52);
x_54 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg(x_49, x_53, x_7, x_2, x_3, x_4, x_5);
lean_dec(x_49);
if (lean_obj_tag(x_54) == 0)
{
lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; 
x_55 = lean_ctor_get(x_54, 0);
lean_inc(x_55);
if (lean_is_exclusive(x_54)) {
 lean_ctor_release(x_54, 0);
 x_56 = x_54;
} else {
 lean_dec_ref(x_54);
 x_56 = lean_box(0);
}
x_57 = lean_ctor_get(x_55, 1);
lean_inc(x_57);
lean_dec(x_55);
x_58 = lean_ctor_get(x_57, 0);
lean_inc(x_58);
lean_dec(x_57);
if (lean_is_scalar(x_56)) {
 x_59 = lean_alloc_ctor(0, 1, 0);
} else {
 x_59 = x_56;
}
lean_ctor_set(x_59, 0, x_58);
return x_59;
}
else
{
lean_object* x_60; lean_object* x_61; lean_object* x_62; 
x_60 = lean_ctor_get(x_54, 0);
lean_inc(x_60);
if (lean_is_exclusive(x_54)) {
 lean_ctor_release(x_54, 0);
 x_61 = x_54;
} else {
 lean_dec_ref(x_54);
 x_61 = lean_box(0);
}
if (lean_is_scalar(x_61)) {
 x_62 = lean_alloc_ctor(1, 1, 0);
} else {
 x_62 = x_61;
}
lean_ctor_set(x_62, 0, x_60);
return x_62;
}
}
}
}
else
{
uint8_t x_63; 
lean_dec(x_26);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
lean_dec_ref(x_1);
x_63 = !lean_is_exclusive(x_27);
if (x_63 == 0)
{
return x_27;
}
else
{
lean_object* x_64; lean_object* x_65; 
x_64 = lean_ctor_get(x_27, 0);
lean_inc(x_64);
lean_dec(x_27);
x_65 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_65, 0, x_64);
return x_65;
}
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
_start:
{
lean_object* x_15; 
x_15 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
lean_dec(x_5);
lean_dec(x_4);
return x_15;
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9; 
x_9 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
lean_dec(x_1);
return x_9;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdN___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lean_Meta_mkProdN(x_1, x_2, x_3, x_4, x_5);
return x_7;
}
}
static lean_object* _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("mk", 2, 2);
return x_1;
}
}
static lean_object* _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__0;
x_2 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0;
x_3 = l_Lean_Name_mkStr2(x_2, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_2);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; 
x_10 = lean_ctor_get(x_2, 0);
x_11 = lean_ctor_get(x_2, 1);
x_12 = l_Lean_instInhabitedExpr;
x_13 = l_Array_back_x21___redArg(x_12, x_10);
lean_inc(x_7);
lean_inc_ref(x_6);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_13);
x_14 = lean_infer_type(x_13, x_4, x_5, x_6, x_7);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; 
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
lean_dec_ref(x_14);
lean_inc(x_7);
lean_inc_ref(x_6);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_15);
x_16 = l_Lean_Meta_getDecLevel(x_15, x_4, x_5, x_6, x_7);
if (lean_obj_tag(x_16) == 0)
{
lean_object* x_17; uint8_t x_18; 
x_17 = lean_ctor_get(x_11, 1);
lean_inc(x_17);
x_18 = !lean_is_exclusive(x_16);
if (x_18 == 0)
{
uint8_t x_19; 
x_19 = !lean_is_exclusive(x_11);
if (x_19 == 0)
{
lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_23; 
x_20 = lean_ctor_get(x_16, 0);
x_21 = lean_ctor_get(x_11, 0);
x_22 = lean_ctor_get(x_11, 1);
lean_dec(x_22);
x_23 = !lean_is_exclusive(x_17);
if (x_23 == 0)
{
lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; uint8_t x_40; 
x_24 = lean_ctor_get(x_17, 0);
x_25 = lean_ctor_get(x_17, 1);
x_26 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1;
x_27 = lean_box(0);
lean_inc(x_25);
x_28 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_28, 0, x_25);
lean_ctor_set(x_28, 1, x_27);
lean_inc(x_20);
x_29 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_29, 0, x_20);
lean_ctor_set(x_29, 1, x_28);
lean_inc_ref(x_29);
x_30 = l_Lean_mkConst(x_26, x_29);
lean_inc(x_24);
lean_inc(x_15);
x_31 = l_Lean_mkApp4(x_30, x_15, x_24, x_13, x_21);
x_32 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_33 = l_Lean_mkConst(x_32, x_29);
x_34 = l_Lean_mkAppB(x_33, x_15, x_24);
x_35 = l_Lean_mkLevelMax(x_25, x_20);
x_36 = l_Lean_Level_normalize(x_35);
lean_dec(x_35);
x_37 = lean_array_pop(x_10);
lean_ctor_set(x_17, 1, x_36);
lean_ctor_set(x_17, 0, x_34);
lean_ctor_set(x_11, 0, x_31);
lean_ctor_set(x_2, 0, x_37);
x_38 = lean_unsigned_to_nat(1u);
x_39 = lean_nat_add(x_3, x_38);
lean_dec(x_3);
x_40 = lean_nat_dec_lt(x_39, x_1);
if (x_40 == 0)
{
lean_dec(x_39);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_ctor_set(x_16, 0, x_2);
return x_16;
}
else
{
lean_free_object(x_16);
x_3 = x_39;
goto _start;
}
}
else
{
lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; uint8_t x_59; 
x_42 = lean_ctor_get(x_17, 0);
x_43 = lean_ctor_get(x_17, 1);
lean_inc(x_43);
lean_inc(x_42);
lean_dec(x_17);
x_44 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1;
x_45 = lean_box(0);
lean_inc(x_43);
x_46 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_46, 0, x_43);
lean_ctor_set(x_46, 1, x_45);
lean_inc(x_20);
x_47 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_47, 0, x_20);
lean_ctor_set(x_47, 1, x_46);
lean_inc_ref(x_47);
x_48 = l_Lean_mkConst(x_44, x_47);
lean_inc(x_42);
lean_inc(x_15);
x_49 = l_Lean_mkApp4(x_48, x_15, x_42, x_13, x_21);
x_50 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_51 = l_Lean_mkConst(x_50, x_47);
x_52 = l_Lean_mkAppB(x_51, x_15, x_42);
x_53 = l_Lean_mkLevelMax(x_43, x_20);
x_54 = l_Lean_Level_normalize(x_53);
lean_dec(x_53);
x_55 = lean_array_pop(x_10);
x_56 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_56, 0, x_52);
lean_ctor_set(x_56, 1, x_54);
lean_ctor_set(x_11, 1, x_56);
lean_ctor_set(x_11, 0, x_49);
lean_ctor_set(x_2, 0, x_55);
x_57 = lean_unsigned_to_nat(1u);
x_58 = lean_nat_add(x_3, x_57);
lean_dec(x_3);
x_59 = lean_nat_dec_lt(x_58, x_1);
if (x_59 == 0)
{
lean_dec(x_58);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_ctor_set(x_16, 0, x_2);
return x_16;
}
else
{
lean_free_object(x_16);
x_3 = x_58;
goto _start;
}
}
}
else
{
lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; uint8_t x_82; 
x_61 = lean_ctor_get(x_16, 0);
x_62 = lean_ctor_get(x_11, 0);
lean_inc(x_62);
lean_dec(x_11);
x_63 = lean_ctor_get(x_17, 0);
lean_inc(x_63);
x_64 = lean_ctor_get(x_17, 1);
lean_inc(x_64);
if (lean_is_exclusive(x_17)) {
 lean_ctor_release(x_17, 0);
 lean_ctor_release(x_17, 1);
 x_65 = x_17;
} else {
 lean_dec_ref(x_17);
 x_65 = lean_box(0);
}
x_66 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1;
x_67 = lean_box(0);
lean_inc(x_64);
x_68 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_68, 0, x_64);
lean_ctor_set(x_68, 1, x_67);
lean_inc(x_61);
x_69 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_69, 0, x_61);
lean_ctor_set(x_69, 1, x_68);
lean_inc_ref(x_69);
x_70 = l_Lean_mkConst(x_66, x_69);
lean_inc(x_63);
lean_inc(x_15);
x_71 = l_Lean_mkApp4(x_70, x_15, x_63, x_13, x_62);
x_72 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_73 = l_Lean_mkConst(x_72, x_69);
x_74 = l_Lean_mkAppB(x_73, x_15, x_63);
x_75 = l_Lean_mkLevelMax(x_64, x_61);
x_76 = l_Lean_Level_normalize(x_75);
lean_dec(x_75);
x_77 = lean_array_pop(x_10);
if (lean_is_scalar(x_65)) {
 x_78 = lean_alloc_ctor(0, 2, 0);
} else {
 x_78 = x_65;
}
lean_ctor_set(x_78, 0, x_74);
lean_ctor_set(x_78, 1, x_76);
x_79 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_79, 0, x_71);
lean_ctor_set(x_79, 1, x_78);
lean_ctor_set(x_2, 1, x_79);
lean_ctor_set(x_2, 0, x_77);
x_80 = lean_unsigned_to_nat(1u);
x_81 = lean_nat_add(x_3, x_80);
lean_dec(x_3);
x_82 = lean_nat_dec_lt(x_81, x_1);
if (x_82 == 0)
{
lean_dec(x_81);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_ctor_set(x_16, 0, x_2);
return x_16;
}
else
{
lean_free_object(x_16);
x_3 = x_81;
goto _start;
}
}
}
else
{
lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; uint8_t x_106; 
x_84 = lean_ctor_get(x_16, 0);
lean_inc(x_84);
lean_dec(x_16);
x_85 = lean_ctor_get(x_11, 0);
lean_inc(x_85);
if (lean_is_exclusive(x_11)) {
 lean_ctor_release(x_11, 0);
 lean_ctor_release(x_11, 1);
 x_86 = x_11;
} else {
 lean_dec_ref(x_11);
 x_86 = lean_box(0);
}
x_87 = lean_ctor_get(x_17, 0);
lean_inc(x_87);
x_88 = lean_ctor_get(x_17, 1);
lean_inc(x_88);
if (lean_is_exclusive(x_17)) {
 lean_ctor_release(x_17, 0);
 lean_ctor_release(x_17, 1);
 x_89 = x_17;
} else {
 lean_dec_ref(x_17);
 x_89 = lean_box(0);
}
x_90 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1;
x_91 = lean_box(0);
lean_inc(x_88);
x_92 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_92, 0, x_88);
lean_ctor_set(x_92, 1, x_91);
lean_inc(x_84);
x_93 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_93, 0, x_84);
lean_ctor_set(x_93, 1, x_92);
lean_inc_ref(x_93);
x_94 = l_Lean_mkConst(x_90, x_93);
lean_inc(x_87);
lean_inc(x_15);
x_95 = l_Lean_mkApp4(x_94, x_15, x_87, x_13, x_85);
x_96 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_97 = l_Lean_mkConst(x_96, x_93);
x_98 = l_Lean_mkAppB(x_97, x_15, x_87);
x_99 = l_Lean_mkLevelMax(x_88, x_84);
x_100 = l_Lean_Level_normalize(x_99);
lean_dec(x_99);
x_101 = lean_array_pop(x_10);
if (lean_is_scalar(x_89)) {
 x_102 = lean_alloc_ctor(0, 2, 0);
} else {
 x_102 = x_89;
}
lean_ctor_set(x_102, 0, x_98);
lean_ctor_set(x_102, 1, x_100);
if (lean_is_scalar(x_86)) {
 x_103 = lean_alloc_ctor(0, 2, 0);
} else {
 x_103 = x_86;
}
lean_ctor_set(x_103, 0, x_95);
lean_ctor_set(x_103, 1, x_102);
lean_ctor_set(x_2, 1, x_103);
lean_ctor_set(x_2, 0, x_101);
x_104 = lean_unsigned_to_nat(1u);
x_105 = lean_nat_add(x_3, x_104);
lean_dec(x_3);
x_106 = lean_nat_dec_lt(x_105, x_1);
if (x_106 == 0)
{
lean_object* x_107; 
lean_dec(x_105);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
x_107 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_107, 0, x_2);
return x_107;
}
else
{
x_3 = x_105;
goto _start;
}
}
}
else
{
uint8_t x_109; 
lean_dec(x_15);
lean_dec(x_13);
lean_free_object(x_2);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
x_109 = !lean_is_exclusive(x_16);
if (x_109 == 0)
{
return x_16;
}
else
{
lean_object* x_110; lean_object* x_111; 
x_110 = lean_ctor_get(x_16, 0);
lean_inc(x_110);
lean_dec(x_16);
x_111 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_111, 0, x_110);
return x_111;
}
}
}
else
{
uint8_t x_112; 
lean_dec(x_13);
lean_free_object(x_2);
lean_dec(x_11);
lean_dec(x_10);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
x_112 = !lean_is_exclusive(x_14);
if (x_112 == 0)
{
return x_14;
}
else
{
lean_object* x_113; lean_object* x_114; 
x_113 = lean_ctor_get(x_14, 0);
lean_inc(x_113);
lean_dec(x_14);
x_114 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_114, 0, x_113);
return x_114;
}
}
}
else
{
lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; 
x_115 = lean_ctor_get(x_2, 0);
x_116 = lean_ctor_get(x_2, 1);
lean_inc(x_116);
lean_inc(x_115);
lean_dec(x_2);
x_117 = l_Lean_instInhabitedExpr;
x_118 = l_Array_back_x21___redArg(x_117, x_115);
lean_inc(x_7);
lean_inc_ref(x_6);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_118);
x_119 = lean_infer_type(x_118, x_4, x_5, x_6, x_7);
if (lean_obj_tag(x_119) == 0)
{
lean_object* x_120; lean_object* x_121; 
x_120 = lean_ctor_get(x_119, 0);
lean_inc(x_120);
lean_dec_ref(x_119);
lean_inc(x_7);
lean_inc_ref(x_6);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_120);
x_121 = l_Lean_Meta_getDecLevel(x_120, x_4, x_5, x_6, x_7);
if (lean_obj_tag(x_121) == 0)
{
lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; uint8_t x_147; 
x_122 = lean_ctor_get(x_116, 1);
lean_inc(x_122);
x_123 = lean_ctor_get(x_121, 0);
lean_inc(x_123);
if (lean_is_exclusive(x_121)) {
 lean_ctor_release(x_121, 0);
 x_124 = x_121;
} else {
 lean_dec_ref(x_121);
 x_124 = lean_box(0);
}
x_125 = lean_ctor_get(x_116, 0);
lean_inc(x_125);
if (lean_is_exclusive(x_116)) {
 lean_ctor_release(x_116, 0);
 lean_ctor_release(x_116, 1);
 x_126 = x_116;
} else {
 lean_dec_ref(x_116);
 x_126 = lean_box(0);
}
x_127 = lean_ctor_get(x_122, 0);
lean_inc(x_127);
x_128 = lean_ctor_get(x_122, 1);
lean_inc(x_128);
if (lean_is_exclusive(x_122)) {
 lean_ctor_release(x_122, 0);
 lean_ctor_release(x_122, 1);
 x_129 = x_122;
} else {
 lean_dec_ref(x_122);
 x_129 = lean_box(0);
}
x_130 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1;
x_131 = lean_box(0);
lean_inc(x_128);
x_132 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_132, 0, x_128);
lean_ctor_set(x_132, 1, x_131);
lean_inc(x_123);
x_133 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_133, 0, x_123);
lean_ctor_set(x_133, 1, x_132);
lean_inc_ref(x_133);
x_134 = l_Lean_mkConst(x_130, x_133);
lean_inc(x_127);
lean_inc(x_120);
x_135 = l_Lean_mkApp4(x_134, x_120, x_127, x_118, x_125);
x_136 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_137 = l_Lean_mkConst(x_136, x_133);
x_138 = l_Lean_mkAppB(x_137, x_120, x_127);
x_139 = l_Lean_mkLevelMax(x_128, x_123);
x_140 = l_Lean_Level_normalize(x_139);
lean_dec(x_139);
x_141 = lean_array_pop(x_115);
if (lean_is_scalar(x_129)) {
 x_142 = lean_alloc_ctor(0, 2, 0);
} else {
 x_142 = x_129;
}
lean_ctor_set(x_142, 0, x_138);
lean_ctor_set(x_142, 1, x_140);
if (lean_is_scalar(x_126)) {
 x_143 = lean_alloc_ctor(0, 2, 0);
} else {
 x_143 = x_126;
}
lean_ctor_set(x_143, 0, x_135);
lean_ctor_set(x_143, 1, x_142);
x_144 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_144, 0, x_141);
lean_ctor_set(x_144, 1, x_143);
x_145 = lean_unsigned_to_nat(1u);
x_146 = lean_nat_add(x_3, x_145);
lean_dec(x_3);
x_147 = lean_nat_dec_lt(x_146, x_1);
if (x_147 == 0)
{
lean_object* x_148; 
lean_dec(x_146);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
if (lean_is_scalar(x_124)) {
 x_148 = lean_alloc_ctor(0, 1, 0);
} else {
 x_148 = x_124;
}
lean_ctor_set(x_148, 0, x_144);
return x_148;
}
else
{
lean_dec(x_124);
x_2 = x_144;
x_3 = x_146;
goto _start;
}
}
else
{
lean_object* x_150; lean_object* x_151; lean_object* x_152; 
lean_dec(x_120);
lean_dec(x_118);
lean_dec(x_116);
lean_dec(x_115);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
x_150 = lean_ctor_get(x_121, 0);
lean_inc(x_150);
if (lean_is_exclusive(x_121)) {
 lean_ctor_release(x_121, 0);
 x_151 = x_121;
} else {
 lean_dec_ref(x_121);
 x_151 = lean_box(0);
}
if (lean_is_scalar(x_151)) {
 x_152 = lean_alloc_ctor(1, 1, 0);
} else {
 x_152 = x_151;
}
lean_ctor_set(x_152, 0, x_150);
return x_152;
}
}
else
{
lean_object* x_153; lean_object* x_154; lean_object* x_155; 
lean_dec(x_118);
lean_dec(x_116);
lean_dec(x_115);
lean_dec(x_7);
lean_dec_ref(x_6);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
x_153 = lean_ctor_get(x_119, 0);
lean_inc(x_153);
if (lean_is_exclusive(x_119)) {
 lean_ctor_release(x_119, 0);
 x_154 = x_119;
} else {
 lean_dec_ref(x_119);
 x_154 = lean_box(0);
}
if (lean_is_scalar(x_154)) {
 x_155 = lean_alloc_ctor(1, 1, 0);
} else {
 x_155 = x_154;
}
lean_ctor_set(x_155, 0, x_153);
return x_155;
}
}
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
_start:
{
lean_object* x_15; 
x_15 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg(x_4, x_6, x_7, x_10, x_11, x_12, x_13);
return x_15;
}
}
static lean_object* _init_l_Lean_Meta_mkProdMkN___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("unit", 4, 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_mkProdMkN___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_mkProdMkN___closed__0;
x_2 = l_Lean_Meta_mkProdN___closed__0;
x_3 = l_Lean_Name_mkStr2(x_2, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdMkN(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_13; lean_object* x_14; uint8_t x_15; 
x_13 = lean_unsigned_to_nat(0u);
x_14 = lean_array_get_size(x_1);
x_15 = lean_nat_dec_lt(x_13, x_14);
lean_dec(x_14);
if (x_15 == 0)
{
lean_object* x_16; 
lean_dec_ref(x_1);
x_16 = l_Lean_Meta_mkFreshLevelMVar(x_2, x_3, x_4, x_5);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
if (lean_obj_tag(x_16) == 0)
{
uint8_t x_17; 
x_17 = !lean_is_exclusive(x_16);
if (x_17 == 0)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; 
x_18 = lean_ctor_get(x_16, 0);
x_19 = l_Lean_Meta_mkProdMkN___closed__1;
x_20 = lean_box(0);
x_21 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_21, 0, x_18);
lean_ctor_set(x_21, 1, x_20);
lean_inc_ref(x_21);
x_22 = l_Lean_mkConst(x_19, x_21);
x_23 = l_Lean_Meta_mkProdN___closed__1;
x_24 = l_Lean_mkConst(x_23, x_21);
x_25 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_25, 0, x_22);
lean_ctor_set(x_25, 1, x_24);
lean_ctor_set(x_16, 0, x_25);
return x_16;
}
else
{
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; 
x_26 = lean_ctor_get(x_16, 0);
lean_inc(x_26);
lean_dec(x_16);
x_27 = l_Lean_Meta_mkProdMkN___closed__1;
x_28 = lean_box(0);
x_29 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_29, 0, x_26);
lean_ctor_set(x_29, 1, x_28);
lean_inc_ref(x_29);
x_30 = l_Lean_mkConst(x_27, x_29);
x_31 = l_Lean_Meta_mkProdN___closed__1;
x_32 = l_Lean_mkConst(x_31, x_29);
x_33 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_33, 0, x_30);
lean_ctor_set(x_33, 1, x_32);
x_34 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_34, 0, x_33);
return x_34;
}
}
else
{
uint8_t x_35; 
x_35 = !lean_is_exclusive(x_16);
if (x_35 == 0)
{
return x_16;
}
else
{
lean_object* x_36; lean_object* x_37; 
x_36 = lean_ctor_get(x_16, 0);
lean_inc(x_36);
lean_dec(x_16);
x_37 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_37, 0, x_36);
return x_37;
}
}
}
else
{
lean_object* x_38; lean_object* x_39; 
x_38 = l_Array_back___redArg(x_1);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_3);
lean_inc_ref(x_2);
lean_inc(x_38);
x_39 = lean_infer_type(x_38, x_2, x_3, x_4, x_5);
if (lean_obj_tag(x_39) == 0)
{
lean_object* x_40; lean_object* x_41; 
x_40 = lean_ctor_get(x_39, 0);
lean_inc(x_40);
lean_dec_ref(x_39);
lean_inc(x_5);
lean_inc_ref(x_4);
lean_inc(x_3);
lean_inc_ref(x_2);
lean_inc(x_40);
x_41 = l_Lean_Meta_getDecLevel(x_40, x_2, x_3, x_4, x_5);
if (lean_obj_tag(x_41) == 0)
{
lean_object* x_42; lean_object* x_43; lean_object* x_44; uint8_t x_45; 
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_dec_ref(x_41);
x_43 = lean_array_pop(x_1);
x_44 = lean_array_get_size(x_43);
x_45 = lean_nat_dec_lt(x_13, x_44);
if (x_45 == 0)
{
lean_dec(x_44);
lean_dec_ref(x_43);
lean_dec(x_42);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
x_7 = x_38;
x_8 = x_40;
x_9 = lean_box(0);
goto block_12;
}
else
{
lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; 
x_46 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_46, 0, x_40);
lean_ctor_set(x_46, 1, x_42);
x_47 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_47, 0, x_38);
lean_ctor_set(x_47, 1, x_46);
x_48 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_48, 0, x_43);
lean_ctor_set(x_48, 1, x_47);
x_49 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg(x_44, x_48, x_13, x_2, x_3, x_4, x_5);
lean_dec(x_44);
if (lean_obj_tag(x_49) == 0)
{
lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 
x_50 = lean_ctor_get(x_49, 0);
lean_inc(x_50);
lean_dec_ref(x_49);
x_51 = lean_ctor_get(x_50, 1);
lean_inc(x_51);
lean_dec(x_50);
x_52 = lean_ctor_get(x_51, 1);
lean_inc(x_52);
x_53 = lean_ctor_get(x_51, 0);
lean_inc(x_53);
lean_dec(x_51);
x_54 = lean_ctor_get(x_52, 0);
lean_inc(x_54);
lean_dec(x_52);
x_7 = x_53;
x_8 = x_54;
x_9 = lean_box(0);
goto block_12;
}
else
{
uint8_t x_55; 
x_55 = !lean_is_exclusive(x_49);
if (x_55 == 0)
{
return x_49;
}
else
{
lean_object* x_56; lean_object* x_57; 
x_56 = lean_ctor_get(x_49, 0);
lean_inc(x_56);
lean_dec(x_49);
x_57 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_57, 0, x_56);
return x_57;
}
}
}
}
else
{
uint8_t x_58; 
lean_dec(x_40);
lean_dec(x_38);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
lean_dec_ref(x_1);
x_58 = !lean_is_exclusive(x_41);
if (x_58 == 0)
{
return x_41;
}
else
{
lean_object* x_59; lean_object* x_60; 
x_59 = lean_ctor_get(x_41, 0);
lean_inc(x_59);
lean_dec(x_41);
x_60 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_60, 0, x_59);
return x_60;
}
}
}
else
{
uint8_t x_61; 
lean_dec(x_38);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
lean_dec_ref(x_1);
x_61 = !lean_is_exclusive(x_39);
if (x_61 == 0)
{
return x_39;
}
else
{
lean_object* x_62; lean_object* x_63; 
x_62 = lean_ctor_get(x_39, 0);
lean_inc(x_62);
lean_dec(x_39);
x_63 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_63, 0, x_62);
return x_63;
}
}
}
block_12:
{
lean_object* x_10; lean_object* x_11; 
x_10 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_10, 0, x_7);
lean_ctor_set(x_10, 1, x_8);
x_11 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_11, 0, x_10);
return x_11;
}
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
_start:
{
lean_object* x_15; 
x_15 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
lean_dec(x_5);
lean_dec(x_4);
return x_15;
}
}
LEAN_EXPORT lean_object* l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9; 
x_9 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
lean_dec(x_1);
return x_9;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_mkProdMkN___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lean_Meta_mkProdMkN(x_1, x_2, x_3, x_4, x_5);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_throwError___at___00Lean_Meta_getProdFields_spec__0_spec__0(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_7 = lean_st_ref_get(x_5);
x_8 = lean_ctor_get(x_7, 0);
lean_inc_ref(x_8);
lean_dec(x_7);
x_9 = lean_st_ref_get(x_3);
x_10 = lean_ctor_get(x_9, 0);
lean_inc_ref(x_10);
lean_dec(x_9);
x_11 = lean_ctor_get(x_2, 2);
x_12 = lean_ctor_get(x_4, 2);
lean_inc(x_12);
lean_inc_ref(x_11);
x_13 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_13, 0, x_8);
lean_ctor_set(x_13, 1, x_10);
lean_ctor_set(x_13, 2, x_11);
lean_ctor_set(x_13, 3, x_12);
x_14 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set(x_14, 0, x_13);
lean_ctor_set(x_14, 1, x_1);
x_15 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_15, 0, x_14);
return x_15;
}
}
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_7; lean_object* x_8; uint8_t x_9; 
x_7 = lean_ctor_get(x_4, 5);
x_8 = l_Lean_addMessageContextFull___at___00Lean_throwError___at___00Lean_Meta_getProdFields_spec__0_spec__0(x_1, x_2, x_3, x_4, x_5);
x_9 = !lean_is_exclusive(x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; 
x_10 = lean_ctor_get(x_8, 0);
lean_inc(x_7);
x_11 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_11, 0, x_7);
lean_ctor_set(x_11, 1, x_10);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 0, x_11);
return x_8;
}
else
{
lean_object* x_12; lean_object* x_13; lean_object* x_14; 
x_12 = lean_ctor_get(x_8, 0);
lean_inc(x_12);
lean_dec(x_8);
lean_inc(x_7);
x_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_7);
lean_ctor_set(x_13, 1, x_12);
x_14 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_14, 0, x_13);
return x_14;
}
}
}
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_8; 
x_8 = l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg(x_2, x_3, x_4, x_5, x_6);
return x_8;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__0() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("Internal error: Expected Prod, got ", 35, 35);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lean_Meta_getProdFields___closed__0;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(" of type ", 9, 9);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; 
x_1 = l_Lean_Meta_getProdFields___closed__2;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("fst", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_getProdFields___closed__4;
x_2 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0;
x_3 = l_Lean_Name_mkStr2(x_2, x_1);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("snd", 3, 3);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_getProdFields___closed__7() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; 
x_1 = l_Lean_Meta_getProdFields___closed__6;
x_2 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0;
x_3 = l_Lean_Name_mkStr2(x_2, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_getProdFields(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_8; 
x_8 = l_Lean_Meta_instantiateMVarsIfMVarApp___redArg(x_2, x_4);
if (lean_obj_tag(x_8) == 0)
{
uint8_t x_9; 
x_9 = !lean_is_exclusive(x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_24; uint8_t x_25; 
x_10 = lean_ctor_get(x_8, 0);
lean_inc(x_10);
x_24 = l_Lean_Expr_cleanupAnnotations(x_10);
x_25 = l_Lean_Expr_isApp(x_24);
if (x_25 == 0)
{
lean_dec_ref(x_24);
lean_free_object(x_8);
x_11 = x_3;
x_12 = x_4;
x_13 = x_5;
x_14 = x_6;
goto block_23;
}
else
{
lean_object* x_26; uint8_t x_27; 
lean_inc_ref(x_24);
x_26 = l_Lean_Expr_appFnCleanup___redArg(x_24);
x_27 = l_Lean_Expr_isApp(x_26);
if (x_27 == 0)
{
lean_dec_ref(x_26);
lean_dec_ref(x_24);
lean_free_object(x_8);
x_11 = x_3;
x_12 = x_4;
x_13 = x_5;
x_14 = x_6;
goto block_23;
}
else
{
lean_object* x_28; lean_object* x_29; uint8_t x_30; 
lean_inc_ref(x_26);
x_28 = l_Lean_Expr_appFnCleanup___redArg(x_26);
x_29 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_30 = l_Lean_Expr_isConstOf(x_28, x_29);
if (x_30 == 0)
{
lean_dec_ref(x_28);
lean_dec_ref(x_26);
lean_dec_ref(x_24);
lean_free_object(x_8);
x_11 = x_3;
x_12 = x_4;
x_13 = x_5;
x_14 = x_6;
goto block_23;
}
else
{
lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; 
lean_dec(x_10);
x_31 = lean_ctor_get(x_24, 1);
lean_inc_ref(x_31);
lean_dec_ref(x_24);
x_32 = lean_ctor_get(x_26, 1);
lean_inc_ref(x_32);
lean_dec_ref(x_26);
x_33 = l_Lean_Meta_getProdFields___closed__5;
x_34 = l_Lean_Expr_constLevels_x21(x_28);
lean_dec_ref(x_28);
lean_inc(x_34);
x_35 = l_Lean_mkConst(x_33, x_34);
lean_inc_ref(x_1);
lean_inc_ref(x_31);
lean_inc_ref(x_32);
x_36 = l_Lean_mkApp3(x_35, x_32, x_31, x_1);
x_37 = l_Lean_Meta_getProdFields___closed__7;
x_38 = l_Lean_mkConst(x_37, x_34);
lean_inc_ref(x_31);
lean_inc_ref(x_32);
x_39 = l_Lean_mkApp3(x_38, x_32, x_31, x_1);
x_40 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_40, 0, x_39);
lean_ctor_set(x_40, 1, x_31);
x_41 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_41, 0, x_32);
lean_ctor_set(x_41, 1, x_40);
x_42 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_42, 0, x_36);
lean_ctor_set(x_42, 1, x_41);
lean_ctor_set(x_8, 0, x_42);
return x_8;
}
}
}
block_23:
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; 
x_15 = l_Lean_Meta_getProdFields___closed__1;
x_16 = l_Lean_MessageData_ofExpr(x_1);
x_17 = lean_alloc_ctor(7, 2, 0);
lean_ctor_set(x_17, 0, x_15);
lean_ctor_set(x_17, 1, x_16);
x_18 = l_Lean_Meta_getProdFields___closed__3;
x_19 = lean_alloc_ctor(7, 2, 0);
lean_ctor_set(x_19, 0, x_17);
lean_ctor_set(x_19, 1, x_18);
x_20 = l_Lean_MessageData_ofExpr(x_10);
x_21 = lean_alloc_ctor(7, 2, 0);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set(x_21, 1, x_20);
x_22 = l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg(x_21, x_11, x_12, x_13, x_14);
return x_22;
}
}
else
{
lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_57; uint8_t x_58; 
x_43 = lean_ctor_get(x_8, 0);
lean_inc(x_43);
lean_dec(x_8);
lean_inc(x_43);
x_57 = l_Lean_Expr_cleanupAnnotations(x_43);
x_58 = l_Lean_Expr_isApp(x_57);
if (x_58 == 0)
{
lean_dec_ref(x_57);
x_44 = x_3;
x_45 = x_4;
x_46 = x_5;
x_47 = x_6;
goto block_56;
}
else
{
lean_object* x_59; uint8_t x_60; 
lean_inc_ref(x_57);
x_59 = l_Lean_Expr_appFnCleanup___redArg(x_57);
x_60 = l_Lean_Expr_isApp(x_59);
if (x_60 == 0)
{
lean_dec_ref(x_59);
lean_dec_ref(x_57);
x_44 = x_3;
x_45 = x_4;
x_46 = x_5;
x_47 = x_6;
goto block_56;
}
else
{
lean_object* x_61; lean_object* x_62; uint8_t x_63; 
lean_inc_ref(x_59);
x_61 = l_Lean_Expr_appFnCleanup___redArg(x_59);
x_62 = l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1;
x_63 = l_Lean_Expr_isConstOf(x_61, x_62);
if (x_63 == 0)
{
lean_dec_ref(x_61);
lean_dec_ref(x_59);
lean_dec_ref(x_57);
x_44 = x_3;
x_45 = x_4;
x_46 = x_5;
x_47 = x_6;
goto block_56;
}
else
{
lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
lean_dec(x_43);
x_64 = lean_ctor_get(x_57, 1);
lean_inc_ref(x_64);
lean_dec_ref(x_57);
x_65 = lean_ctor_get(x_59, 1);
lean_inc_ref(x_65);
lean_dec_ref(x_59);
x_66 = l_Lean_Meta_getProdFields___closed__5;
x_67 = l_Lean_Expr_constLevels_x21(x_61);
lean_dec_ref(x_61);
lean_inc(x_67);
x_68 = l_Lean_mkConst(x_66, x_67);
lean_inc_ref(x_1);
lean_inc_ref(x_64);
lean_inc_ref(x_65);
x_69 = l_Lean_mkApp3(x_68, x_65, x_64, x_1);
x_70 = l_Lean_Meta_getProdFields___closed__7;
x_71 = l_Lean_mkConst(x_70, x_67);
lean_inc_ref(x_64);
lean_inc_ref(x_65);
x_72 = l_Lean_mkApp3(x_71, x_65, x_64, x_1);
x_73 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_73, 0, x_72);
lean_ctor_set(x_73, 1, x_64);
x_74 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_74, 0, x_65);
lean_ctor_set(x_74, 1, x_73);
x_75 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_75, 0, x_69);
lean_ctor_set(x_75, 1, x_74);
x_76 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_76, 0, x_75);
return x_76;
}
}
}
block_56:
{
lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; 
x_48 = l_Lean_Meta_getProdFields___closed__1;
x_49 = l_Lean_MessageData_ofExpr(x_1);
x_50 = lean_alloc_ctor(7, 2, 0);
lean_ctor_set(x_50, 0, x_48);
lean_ctor_set(x_50, 1, x_49);
x_51 = l_Lean_Meta_getProdFields___closed__3;
x_52 = lean_alloc_ctor(7, 2, 0);
lean_ctor_set(x_52, 0, x_50);
lean_ctor_set(x_52, 1, x_51);
x_53 = l_Lean_MessageData_ofExpr(x_43);
x_54 = lean_alloc_ctor(7, 2, 0);
lean_ctor_set(x_54, 0, x_52);
lean_ctor_set(x_54, 1, x_53);
x_55 = l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg(x_54, x_44, x_45, x_46, x_47);
return x_55;
}
}
}
else
{
uint8_t x_77; 
lean_dec_ref(x_1);
x_77 = !lean_is_exclusive(x_8);
if (x_77 == 0)
{
return x_8;
}
else
{
lean_object* x_78; lean_object* x_79; 
x_78 = lean_ctor_get(x_8, 0);
lean_inc(x_78);
lean_dec(x_8);
x_79 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_79, 0, x_78);
return x_79;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
lean_object* x_8; 
x_8 = l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_6);
lean_dec_ref(x_5);
lean_dec(x_4);
lean_dec_ref(x_3);
return x_8;
}
}
LEAN_EXPORT lean_object* l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lean_throwError___at___00Lean_Meta_getProdFields_spec__0___redArg(x_1, x_2, x_3, x_4, x_5);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_addMessageContextFull___at___00Lean_throwError___at___00Lean_Meta_getProdFields_spec__0_spec__0___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; 
x_7 = l_Lean_addMessageContextFull___at___00Lean_throwError___at___00Lean_Meta_getProdFields_spec__0_spec__0(x_1, x_2, x_3, x_4, x_5);
lean_dec(x_5);
lean_dec_ref(x_4);
lean_dec(x_3);
lean_dec_ref(x_2);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_getProdFields___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
lean_object* x_8; 
x_8 = l_Lean_Meta_getProdFields(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_6);
lean_dec_ref(x_5);
lean_dec(x_4);
lean_dec_ref(x_3);
return x_8;
}
}
lean_object* initialize_Lean_Meta_InferType(uint8_t builtin);
lean_object* initialize_Lean_Meta_DecLevel(uint8_t builtin);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Lean_Meta_ProdN(uint8_t builtin) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Lean_Meta_InferType(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_DecLevel(builtin);
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0 = _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0();
lean_mark_persistent(l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__0);
l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1 = _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1();
lean_mark_persistent(l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdN_spec__0___redArg___closed__1);
l_Lean_Meta_mkProdN___closed__0 = _init_l_Lean_Meta_mkProdN___closed__0();
lean_mark_persistent(l_Lean_Meta_mkProdN___closed__0);
l_Lean_Meta_mkProdN___closed__1 = _init_l_Lean_Meta_mkProdN___closed__1();
lean_mark_persistent(l_Lean_Meta_mkProdN___closed__1);
l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__0 = _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__0();
lean_mark_persistent(l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__0);
l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1 = _init_l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1();
lean_mark_persistent(l_Std_Rxo_Iterator_instIteratorLoop_loop___at___00Lean_Meta_mkProdMkN_spec__0___redArg___closed__1);
l_Lean_Meta_mkProdMkN___closed__0 = _init_l_Lean_Meta_mkProdMkN___closed__0();
lean_mark_persistent(l_Lean_Meta_mkProdMkN___closed__0);
l_Lean_Meta_mkProdMkN___closed__1 = _init_l_Lean_Meta_mkProdMkN___closed__1();
lean_mark_persistent(l_Lean_Meta_mkProdMkN___closed__1);
l_Lean_Meta_getProdFields___closed__0 = _init_l_Lean_Meta_getProdFields___closed__0();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__0);
l_Lean_Meta_getProdFields___closed__1 = _init_l_Lean_Meta_getProdFields___closed__1();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__1);
l_Lean_Meta_getProdFields___closed__2 = _init_l_Lean_Meta_getProdFields___closed__2();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__2);
l_Lean_Meta_getProdFields___closed__3 = _init_l_Lean_Meta_getProdFields___closed__3();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__3);
l_Lean_Meta_getProdFields___closed__4 = _init_l_Lean_Meta_getProdFields___closed__4();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__4);
l_Lean_Meta_getProdFields___closed__5 = _init_l_Lean_Meta_getProdFields___closed__5();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__5);
l_Lean_Meta_getProdFields___closed__6 = _init_l_Lean_Meta_getProdFields___closed__6();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__6);
l_Lean_Meta_getProdFields___closed__7 = _init_l_Lean_Meta_getProdFields___closed__7();
lean_mark_persistent(l_Lean_Meta_getProdFields___closed__7);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus
}
#endif
